<!DOCTYPE html>
<html>
<head>
<title>Weiran ECMAScript Applications Framework</title>
<link rel=stylesheet type=text/css href=./style.css>
</head>

<body>

<div class=leftbar>
    <h1>Weiran</h1>
    <p>ECMAScript<br />Applications Framework</p>
    <p>Version: 1.2</p>
    <ul>
	<li><a href=Weiran.html>Weiran</a></li>
	<li><a href=Weiran.Array.html>Weiran.Array</a></li>
	<li><a href=Weiran.Buffer.html>Weiran.Buffer</a></li>
	<li><a href=Weiran.Class.html>Weiran.Class</a></li>
	<li><a href=Weiran.Date.html>Weiran.Date</a></li>
	<li><a href=Weiran.DB.html>Weiran.DB</a></li>
	<li><a href=Weiran.Event.html>Weiran.Event</a></li>
	<li><a href=Weiran.Events.html>Weiran.Events</a></li>
	<li><a href=Weiran.Function.html>Weiran.Function</a></li>
	<li><a href=Weiran.JSON.html>Weiran.JSON</a></li>
	<li>Weiran.Lang<ul>
	    <li><a href=#Weiran.Lang.setCode>Weiran.Lang.setCode</a></li>
	    <li><a href=#Weiran.Lang.getCode>Weiran.Lang.getCode</a></li>
	    <li><a href=#Weiran.Lang.add>Weiran.Lang.add</a></li>
	    <li><a href=#Weiran.Lang.translate>Weiran.Lang.translate</a></li>
	    <li><a href=#Weiran.i18n>Weiran.i18n</a></li>
	</ul></li>
	<li><a href=Weiran.Number.html>Weiran.Number</a></li>
	<li><a href=Weiran.String.html>Weiran.String</a></li>
	<li><a href=Weiran.GRUB.html>GRUB Mechanism</a></li>
    </ul>
    <p>
        Copyright &copy; All<span>i</span>dylls<br />
        2011 - 2012
    </p>
</div>

<div class=content>

<div class=reftitle>Weiran.Lang</div>
<p>Sub namespace contains internationalization functions.</p>

<a name=Weiran.Lang.setCode></a>
<h3><code>Weiran.Lang.setCode(code)</code></h3>
<p><b>Static method</b></p>
<p>
    <b>Parameters:</b><br />
    <span class=parameters>code</span> - <code>string</code>, language code
</p>
<p><b>Returns: </b><code>undefined</code></p>
<p>Set the language code for string translation.
    This code is used by the <code>Weiran.Lang.translate</code> method.
    These codes follow the IETF recommendations at
    <a target=_blank href=http://www.ietf.org/rfc/rfc3066.txt>http://www.ietf.org/rfc/rfc3066.txt</a>.
    If no value is set, the browser's language setting will be tested.</p>

<a name=Weiran.Lang.getCode></a>
<h3><code>Weiran.Lang.getCode()</code></h3>
<p><b>Static method</b></p>
<p>
    <b>Parameters:</b>
</p>
<p><b>Returns: </b><code>string</code></p>
<p>Returns the current language code.</p>

<a name=Weiran.Lang.add></a>
<h3><code>Weiran.Lang.add(code, key, word)</code></h3>
<p><b>Static method</b></p>
<p>
    <b>Parameters:</b><br />
    <span class=parameters>code</span> - <code>string</code>, language code<br />
    <span class=parameters>key</span> - <code>string</code>, key of word<br />
    <span class=parameters>word</span> - <code>string</code>, word in code
</p>
<p><b>Returns: </b><code>boolean</code></p>
<p>Returns whether an item be added into dictionary successfully.
    The dictionary can be extended (NOT modified) dynamically by calling this method.</p>

<a name=Weiran.Lang.translate></a>
<h3><code>Weiran.Lang.translate(key)</code></h3>
<p><b>Static method</b></p>
<p>
    <b>Parameters:</b><br />
    <span class=parameters>key</span> - <code>string</code>, key of word
</p>
<p><b>Returns: </b><code>string</code></p>
<p>Returns a internationalized string. Looks up a key from a dictionary based on the current language string.
    The value of <code>Weiran.Lang.getCode</code> will be used to determine the appropriate dictionary.
    Dictionaries are stored in <code>Weiran.Lang[code]</code>.</p>

<a name=Weiran.i18n></a>
<h3><code>Weiran.i18n(key)</code></h3>
<p><b>Static method</b></p>
<p>
    <b>Parameters:</b><br />
    <span class=parameters>key</span> - <code>string</code>, key of word
</p>
<p><b>Returns: </b><code>string</code></p>
<p>Alias of <code>Weiran.Lang.translate</code>.</p>

</div>

</body>
</html>
